#pragma once

#include "vectormath.h"

namespace Tmpl {

struct Vertex
{
public:
	Vertex(){}
	Vertex(Vec3f aPos):pos(aPos){}

	Vec3f pos;
};
	
class Triangle
{
public:
	Triangle(){}
	Triangle(int V0, Vec2f UV0, int V1, Vec2f UV1, int V2, Vec2f UV2)
	{
		v0 = V0; uv0 = UV0;
		v1 = V1; uv1 = UV1;
		v2 = V2; uv2 = UV2;
	}

	int v0, v1, v2;
	Vec2f uv0, uv1, uv2;
};

class Sphere
{
public:
	Sphere();
	void SubDivide();
	void Render();

	int GetTriangleCount(){return mTriangleCount;}

	Vec2f GetTextureCoord(const Vec3f& normal);
private:
	Triangle* mTriangles;
	int mTriangleCount;

	Vertex* mVertices;
	int mVertexCount;
};

}; // namespace Tmpl